package com.lanxin.oa.zc.service.serviceImpl;

import com.lanxin.bean.ZcAssettype;
import com.lanxin.oa.zc.dao.ZcTypeDao;
import com.lanxin.oa.zc.service.ZcTypeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class ZcTypeServiceImpl implements ZcTypeService {
    @Resource
    private ZcTypeDao typedao;
    @Override
    public List selectzctype() {
       List<ZcAssettype> list=typedao.selectzctypes();
       return list;
    }

    @Override
    public void addzctype(ZcAssettype zctype) {
        typedao.add(zctype);
    }

    @Override
    public void updatezctype(Integer oid, String status) {
        ZcAssettype zctype=typedao.selectzctyoebyid(oid);
        if(status.equals("0")){
            zctype.setStatus("1");
        }else {
            zctype.setStatus("0");
        }
        typedao.update(zctype);

    }

    @Override
    public void deletezctype(Integer oid) {
        ZcAssettype zc=typedao.selectzctyoebyid(oid);
        typedao.delete(zc);
    }


}
